package li;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;;
public class demo19 {
	public static void main(String args[]) throws IOException{
		String path="C:\\text.txt";
		FileInputStream in=new FileInputStream(path);
		BufferedReader reader=new BufferedReader(new InputStreamReader(in));
		FileReader file=new FileReader(path);
		String str="";
		String line="";
		int c;
		while((c=file.read())!=-1){
			str+=(char)c;
			System.out.println((char)c);
			
		}
		file.close();
		System.out.println(str);
	}
	
}
